<template>
    <view class="content">
		<view style="padding: 30rpx 0;">扫描结果：{{result}}</view>
		<button type="primary" @click="scan1">开启扫描</button>
    </view>
</template>

<script>
	// import {ScanOptions,scanBarCode } from "@/uni_modules/xt-barcode-scan"  
	import {scanCode} from '@/uni_modules/lime-scan';
    export default {
        data() {
            return {
                title: 'scan result placehodle',
                fptah : "",
                basesrc: "/static/logo.png",
				type: '',
			    result: '',

            }
        },
        onLoad() {

        },
        methods: {
			// scan() {
			// 	scanBarCode({  
			// 		params: '{"cameraDevice":"WDY-AN00","showVibrate": true,"showBeep": true,"showPhotoAlbum": true,"showLightController": true,"supportZoom": true,"scanColor": "#ff0000","fullScreenScan":true}',  
			// 		complete: (res) => {  
			// 			this.result = res
			// 			console.log(res);  
			// 		}  
			// 	});	
			// },
			scan1() {
				scanCode({
					success: (res)=> {
						this.result = res.result
						console.log('扫码类型:', res.scanType)
						console.log(res)
					},
					fail : (err) => {
						console.log(err)
					},
					complete : (msg) =>{
						console.log(msg)
					}
					
				})
			}
        },

    }
	    
</script>

<style>
    .content {
		margin-top: 200px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .imgi{
        max-width: 100%; /* 响应式图片 */
          height: auto; /* 保持图片比例 */
          border-radius: 5px; /* 添加圆角 */
    }

    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }

    .text-area {
        display: flex;
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
    .text-wrapper {
        height: 500rpx;
        width: 500rpx;
      word-break: break-all;
      word-wrap: break-word
    }
</style>